﻿<!DOCTYPE html>
<html>
<head>
<title>Help Me</title>
<script src="/js/layout.js" type="text/javascript"></script>
<script type="text/javascript">
	function HelpMeViewModel() {
		var self = this;

		self.services = ko.observableArray([]);
		self.MacInfo = ko.observableArray();

		wmi('select * from Win32_Service', function(data) {
			self.services(data);
		});

		wmi('Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True', function(data) {
			self.MacInfo(data);
		});
	}

	$(function() {
		$('#tabs').tabs();
		ko.applyBindings(new HelpMeViewModel());

	});
</script>
</head>
<body>
	<div id="tabs">
		<ul>
			<li><a href="#tabs-1">服务</a></li>
			<li><a href="#tabs-2">Test</a></li>
		</ul>
		<div id="tabs-1">
			<table class="table">
				<thead>
					<tr>
						<th>Index</th>
						<th>Caption</th>
						<th>State</th>
						<th>Status</th>
						<th>Description</th>
					</tr>
				</thead>
				<tbody data-bind="foreach:services">
					<tr>
						<td data-bind="text:$index()+1"></td>
						<td data-bind="text:Caption"></td>
						<td data-bind="text:State"></td>
						<td data-bind="text:Status"></td>
						<td data-bind="text:Description"></td>
					</tr>
				</tbody>
			</table>
		</div>
		<div id="tabs-2">
			<table class="table">
				<thead>
					<tr>
						<th>Index</th>
						<th>Caption</th>
						<th>Address</th>
						<th>DHCPServer</th>
					</tr>
				</thead>
				<tbody data-bind="foreach:MacInfo">
					<tr>
						<td data-bind="text:$index()+1"></td>
						<td data-bind="text:Caption"></td>
						<td data-bind="text:MACAddress"></td>
						<td data-bind="text:DHCPServer"></td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
</body>
</html>
